/* 内容脚本样式文件 */

/* 插件增强样式 */
.tobacco-helper-highlight {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5) !important;
    transition: all 0.3s ease !important;
}

.tobacco-helper-processed {
    position: relative;
}

.tobacco-helper-enhanced {
    position: relative;
}

.tobacco-helper-enhanced::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 100;
}

/* 工具栏样式 */
.tobacco-helper-toolbar {
    position: fixed;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 12px;
    min-width: 200px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.tobacco-helper-status {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.tobacco-helper-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    margin: 3px 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.tobacco-helper-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.tobacco-helper-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

/* 右键菜单样式 */
.tobacco-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    font-size: 12px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    min-width: 120px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.tobacco-context-menu div {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.tobacco-context-menu div:last-child {
    border-bottom: none;
}

.tobacco-context-menu div:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

/* 通知样式 */
.tobacco-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 10002;
    font-size: 14px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 500;
    max-width: 300px;
    word-wrap: break-word;
}

.tobacco-notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.tobacco-notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.tobacco-notification.info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

/* 表格行增强样式 */
.cq_buy_main_grid_row.tobacco-helper-processed {
    transition: all 0.2s ease;
}

.cq_buy_main_grid_row.tobacco-helper-processed:hover {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

/* 输入框增强样式 */
input[name*="qty"].tobacco-helper-enhanced {
    border: 2px solid #667eea !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    transition: all 0.2s ease !important;
}

input[name*="qty"].tobacco-helper-enhanced:focus {
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3) !important;
    border-color: #5a6fd8 !important;
}

/* 重要商品标记 */
.tobacco-important-item {
    background: linear-gradient(90deg, #fff3cd 0%, #ffffff 100%) !important;
    border-left: 4px solid #ffc107 !important;
}

.tobacco-important-item::before {
    content: '⭐';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 10;
}

/* 加载动画 */
.tobacco-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.tobacco-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: tobacco-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes tobacco-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滑入滑出动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* 工具提示样式 */
.tobacco-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 10003;
    pointer-events: none;
    white-space: nowrap;
    animation: fadeIn 0.2s ease;
}

.tobacco-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* 统计信息面板 */
.tobacco-stats-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 12px;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.tobacco-stats-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.tobacco-stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 2px 0;
}

.tobacco-stats-label {
    color: #666;
}

.tobacco-stats-value {
    font-weight: bold;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .tobacco-helper-toolbar {
        top: 5px;
        right: 5px;
        padding: 10px;
        min-width: 150px;
    }
    
    .tobacco-helper-btn {
        padding: 6px 10px;
        font-size: 10px;
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .tobacco-helper-toolbar {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .tobacco-stats-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .tobacco-helper-toolbar {
        background: rgba(33, 37, 41, 0.95);
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .tobacco-helper-status {
        color: #20c997;
        border-bottom-color: #495057;
    }
    
    .tobacco-context-menu {
        background: rgba(33, 37, 41, 0.95);
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .tobacco-context-menu div:hover {
        background-color: #495057;
        color: #20c997;
    }
    
    .tobacco-stats-panel {
        background: rgba(33, 37, 41, 0.95);
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .tobacco-stats-title {
        color: #f8f9fa;
        border-bottom-color: #495057;
    }
    
    .tobacco-stats-label {
        color: #adb5bd;
    }
}

/* 打印样式 */
@media print {
    .tobacco-helper-toolbar,
    .tobacco-context-menu,
    .tobacco-notification,
    .tobacco-stats-panel {
        display: none !important;
    }
    
    .tobacco-helper-highlight {
        background-color: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}